home *** CD-ROM | disk | FTP | other *** search
- function loadImage(mc, node, extrapath)
- {
- var _loc3_ = extrapath;
- if(_loc3_ == null)
- {
- _loc3_ = "";
- }
- var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
- var _loc1_ = node.firstChild.nodeValue;
- var _loc2_ = node.attributes.path;
- if(_loc2_ != null)
- {
- _loc1_ = _loc2_ + _loc1_;
- }
- else
- {
- _loc1_ = strDefaultPath + _loc3_ + _loc1_;
- }
- if(strPathPrefix == null)
- {
- strPathPrefix = "";
- }
- mc.loadMovie(strPathPrefix + _loc1_);
- }
- function addLink(mc)
- {
- Links[mc.link] = mc;
- }
- function getMCfromLink(Item)
- {
- var _loc1_ = Item;
- if(Links[_loc1_] == null)
- {
- var _loc2_ = [];
- while(_loc1_ != sideMenu.ItemHome)
- {
- _loc2_.unshift(_loc1_._name.split("_").pop());
- _loc1_ = _loc1_._parent._parent;
- }
- var _loc3_ = _loc2_.join("/");
- Links[_loc1_] = Links[_loc3_];
- }
- return Links[_loc1_];
- }
- function removeLinkListener()
- {
- Tardis.sideMenu.EB.removeListener(this);
- }
- function init()
- {
- build();
- _visible = true;
- trackUp(mc_t_1);
- }
- function interrupt()
- {
- fade(this.snd,0,55);
- mc_controls.gotoAndStop("paused");
- }
- function resume()
- {
- snd.setVolume(55);
- }
- function build()
- {
- var strID = Tardis.ActiveSection.id;
- var Colors = Tardis.Colors;
- strColor = Colors.getString(strID);
- strColor2 = Colors.getString(strID + "50");
- SECTION_COLOR = Colors.getHex(strID);
- SECTION_COLOR50 = Colors.getHex(strID + "50");
- DEFAULT_COLOR = Colors.getHex("default");
- DEFAULT_COLOR50 = Colors.getHex("default50");
- defaultColor = new Color(bodyLinkMC.arrowMC);
- defaultColor.setRGB(SECTION_COLOR50);
- var ndbuttons = nodeData.byName("buttons");
- txtListenTo.htmlText = ndbuttons.byName("listen").getText();
- txtListenTo.textColor = SECTION_COLOR;
- txtListenTo.resize = "left";
- loadImage(mc_cover,nodeData.byName("image"));
- var ndTracks = nodeData.byName("tracks");
- strTrackpath = Tardis.ASSETS_FOLDER + ndTracks.attributes.path;
- var ndBodyLink = nodeData.byName("link");
- if(ndBodyLink.byName("label").getText() != null)
- {
- animatedLink = false;
- bodyLinkMC.printable = false;
- bodyLinkMC.contentFF.htmlText = ndBodyLink.byName("label").getText();
- bodyLinkMC.contentFF.textColor = SECTION_COLOR50;
- var arwColor = new Color("bodyLinkMC.arrowMC.arwHolder");
- bodyLinkMC.arrowMC.arwColor.setRGB(SECTION_COLOR50);
- bodyLinkMC.link = ndBodyLink.attributes.link;
- bodyLinkMC.navLink = true;
- bodyLinkMC.contentFF.autoSize = true;
- bodyLinkMC.btn._width = bodyLinkMC.contentFF._width + bodyLinkMC.arrowMC._x - 20;
- bodyLinkMC.arrowMC._x = bodyLinkMC.contentFF._x + bodyLinkMC.contentFF._width + 1;
- bodyLinkMC.mAnimatedLink._visible = false;
- }
- else if(ndBodyLink.byName("label_animated").getText() != null)
- {
- animatedLink = true;
- bodyLinkMC.printable = false;
- var arrLabels = ndBodyLink.byName("label_animated").getText().split("|");
- bodyLinkMC.arrowMC._visible = false;
- bodyLinkMC.mAnimatedLink.bigText = arrLabels[0];
- bodyLinkMC.mAnimatedLink.smallText = arrLabels[1];
- bodyLinkMC.mAnimatedLink.linkColor = SECTION_COLOR50;
- bodyLinkMC.mAnimatedLink._visible = true;
- bodyLinkMC.link = ndBodyLink.attributes.link;
- bodyLinkMC.navLink = true;
- bodyLinkMC.btn._width = bodyLinkMC.contentFF._width + bodyLinkMC.arrowMC._x - 20;
- }
- else
- {
- bodyLinkMC.arrowMC._visible = false;
- bodyLinkMC._y = 385;
- bodyLinkMC._height = 0;
- bodyLinkMC._visible = false;
- bodyLinkMC.btn.enabled = false;
- }
- arrTracks = [];
- arrClips = [];
- var ndTrack;
- var strClip;
- var objClip;
- var n = 0;
- while(n < ndTracks.childNodes.length)
- {
- ndTrack = ndTracks.childNodes[n];
- arrTracks.push(ndTrack.attributes.file);
- attachMovie("trackListingMC","mc_t_" + (n + 1),++depth);
- objClip = eval("mc_t_" + (n + 1));
- objClip._x = 9;
- if(ndTrack.byName("title").getText() != null)
- {
- objClip.anim_mc._visible = false;
- objClip.titleHolderMC.titleFF.htmlText = ndTrack.byName("title").getText();
- objClip.titleHolderMC.titleFF.textColor = DEFAULT_COLOR50;
- objClip.titleHolderMC.titleFF.relead();
- }
- else
- {
- var arrLabels = ndTrack.byName("title_animated").getText().split("|");
- objClip.anim_mc.mBuyOnlineText.contentFF.htmlText = arrLabels[0];
- objClip.anim_mc.mBuyOnlineText2.contentFF.htmlText = arrLabels[1];
- objClip.anim_mc.mBuyOnlineText.contentFF.textColor = DEFAULT_COLOR50;
- objClip.anim_mc.mBuyOnlineText2.contentFF.textColor = DEFAULT_COLOR50;
- objClip.titleHolderMC._visible = false;
- }
- objClip._y = TRACKS_POS;
- TRACKS_POS += objClip._height;
- arrClips.push(objClip);
- n++;
- }
- arrayPos = 0;
- currentTrack = arrClips[arrayPos];
- }
- function soundComplete()
- {
- var _loc1_ = false;
- arrayPos++;
- if(arrayPos == arrClips.length)
- {
- if(arrClips.length <= 2)
- {
- _loc1_ = true;
- }
- else
- {
- arrayPos = 0;
- }
- }
- if(_loc1_)
- {
- snd.stop();
- mc_timebar.setHandle(0);
- }
- else
- {
- currentTrack = arrClips[arrayPos];
- trackUp(currentTrack);
- }
- mc_controls.gotoAndStop("standby");
- }
- function soundRewind()
- {
- snd.stop();
- snd.start(0);
- }
- function soundPlay()
- {
- createEmptyMovieClip("track_sound",++depth);
- snd = new Sound(track_sound);
- snd.setVolume(55);
- snd.onSoundComplete = function()
- {
- soundComplete();
- };
- snd.onLoad = function()
- {
- this.start();
- };
- var _loc1_ = strTrackpath + arrTracks[nmTrackNum - 1] + ".mp3";
- snd.loadSound(_loc1_,false);
- mc_timebar.play();
- }
- function soundResume(posToStart)
- {
- var _loc1_ = posToStart;
- if(_loc1_ == null)
- {
- sndPos = snd.position / 1000;
- }
- else
- {
- nmPos = _loc1_;
- }
- if(_loc1_ == 0)
- {
- trackUp(currentTrack);
- }
- else
- {
- snd.start(nmPos,1);
- }
- mc_controls.gotoAndStop("active");
- }
- function soundPause()
- {
- snd.stop();
- }
- function soundStop()
- {
- snd.stop();
- delete snd;
- mc_sound.removeMovieClip();
- }
- function trackOver(obj)
- {
- obj.gotoAndStop("over");
- }
- function trackOut(obj)
- {
- obj.gotoAndStop("off");
- }
- function trackUp(obj)
- {
- var _loc1_ = obj;
- if(nmTrackNum > 0)
- {
- trackOut(this["mc_t_" + nmTrackNum]);
- }
- currentTrack = _loc1_;
- nmTrackNum = parseInt(_loc1_._name.split("_")[2]);
- arrayPos = nmTrackNum - 1;
- soundStop();
- soundPlay();
- _loc1_.gotoAndStop("on");
- }
- function txtOver(mc)
- {
- var _loc1_ = mc;
- _loc1_.gotoAndStop("over");
- Tardis.sideMenu.doOver(_loc1_.link);
- if(_loc1_ == bodyLinkMC)
- {
- if(animatedLink)
- {
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.txtLabel.textColor = SECTION_COLOR;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText2.contentFF.textColor = SECTION_COLOR;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.arrowMC.gotoAndStop("on");
- }
- else
- {
- bodyLinkMC.arrowMC.gotoAndStop("on");
- bodyLinkMC.contentFF.textColor = SECTION_COLOR;
- }
- }
- }
- function txtOut(mc)
- {
- var _loc1_ = mc;
- _loc1_.gotoAndStop("off");
- Tardis.sideMenu.doOut(_loc1_.link);
- if(_loc1_ == bodyLinkMC)
- {
- if(animatedLink)
- {
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.txtLabel.textColor = SECTION_COLOR50;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText2.contentFF.textColor = SECTION_COLOR50;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.arrowMC.gotoAndStop("off");
- }
- else
- {
- bodyLinkMC.arrowMC.gotoAndStop("off");
- bodyLinkMC.contentFF.textColor = SECTION_COLOR50;
- }
- }
- }
- function txtUp()
- {
- if(bodyLinkMC.navLink)
- {
- Tardis.sideMenu.doUp(bodyLinkMC.link);
- }
- else
- {
- Tardis.webPageOpen(bodyLinkMC.link,"_blank");
- }
- }
- function doOver(num)
- {
- if(bodyLinkMC.link == num)
- {
- mc_buy_btn.gotoAndStop("over");
- if(animatedLink)
- {
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.txtLabel.textColor = SECTION_COLOR;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText2.contentFF.textColor = SECTION_COLOR;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.arrowMC.gotoAndStop("on");
- }
- else
- {
- bodyLinkMC.arrowMC.gotoAndStop("on");
- bodyLinkMC.contentFF.textColor = SECTION_COLOR;
- }
- }
- }
- function doOut(num)
- {
- mc_buy_btn.gotoAndStop("off");
- if(bodyLinkMC.link == num)
- {
- if(animatedLink)
- {
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.txtLabel.textColor = SECTION_COLOR50;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText2.contentFF.textColor = SECTION_COLOR50;
- bodyLinkMC.mAnimatedLink.mBuyOnlineText.arrowMC.gotoAndStop("off");
- }
- else
- {
- bodyLinkMC.arrowMC.gotoAndStop("off");
- bodyLinkMC.contentFF.textColor = SECTION_COLOR50;
- }
- }
- }
- function startTimebar()
- {
- var _loc1_ = this;
- mc_timebar.onEnterFrame = function()
- {
- var _loc1_ = this;
- if(_loc1_.DRAGGING == true)
- {
- var _loc2_ = _loc1_.mc_handle._x / _loc1_.AVAIL_WIDTH;
- var f = Math.round(_loc2_ * _loc1_._parent.snd.duration);
- }
- else if(_loc1_._parent.mc_controls._currentFrame == 20)
- {
- _loc2_ = _loc1_._parent.snd.position / _loc1_._parent.snd.duration;
- if(_loc2_ < 1)
- {
- _loc1_.mc_handle._x = _loc2_ * _loc1_.AVAIL_WIDTH;
- }
- }
- };
- }
- function clearUp()
- {
- mc_timebar.onEnterFrame = null;
- }
- function setWidth(nm)
- {
- mc_timebar.mc_track._width = nm;
- mc_timebar.AVAIL_WIDTH = nm - mc_timebar.mc_handle._width;
- }
- function setTarget(mc)
- {
- mc_timebar.TARGET = mc;
- }
- Links = {};
- Tardis.sideMenu.EB.addListener(this);
- _visible = false;
- TRACKS_POS = 226;
- depth = 0;
- this.onUnload = function()
- {
- interrupt();
- removeLinkListener();
- this.onUnload = null;
- };
- TextField.prototype.relead = function()
- {
- this.autoSize = true;
- };
- nmTrackNum = 0;
- setTarget(snd);
- setWidth(163);
- startTimebar();
- mc_timebar.mc_handle.btn.onPress = function()
- {
- var _loc1_ = this;
- _loc1_._parent.startDrag(false,0,0,_loc1_._parent._parent.AVAIL_WIDTH,0);
- _loc1_._parent._parent.DRAGGING = true;
- _loc1_._parent._parent._parent.soundPause();
- };
- mc_timebar.mc_handle.btn.onRelease = mc_timebar.mc_handle.btn.onReleaseOutside = function()
- {
- var _loc1_ = this;
- _loc1_.posToStart = math.ceil(_loc1_._parent._parent.mc_handle._x / _loc1_._parent._parent.AVAIL_WIDTH * _loc1_._parent._parent._parent.snd.duration / 1000);
- if(_loc1_._parent._parent._parent.mc_controls._currentFrame != 30)
- {
- _loc1_._parent._parent._parent.soundResume(_loc1_.posToStart);
- }
- _loc1_._parent.stopDrag();
- _loc1_._parent._parent.DRAGGING = false;
- };
- mc_timebar.mc_handle.btn.onRollOver = function()
- {
- var _loc1_ = this;
- _loc1_.myColor = new Color(_loc1_._parent.scrubbaMC);
- _loc1_.myColor.setRGB(_loc1_._parent._parent._parent.SECTION_COLOR);
- };
- mc_timebar.mc_handle.btn.onRollOut = function()
- {
- var _loc1_ = this;
- _loc1_.myColor = new Color(_loc1_._parent.scrubbaMC);
- _loc1_.myColor.setRGB(_loc1_._parent._parent._parent.DEFAULT_COLOR);
- };
- stop();
- onReady();
- onComplete();
-